package com.cheng.mybatis03.service.impl;

import com.cheng.mybatis03.dao.DeptMapper;
import com.cheng.mybatis03.entity.Dept;
import com.cheng.mybatis03.service.DeptService;

import java.util.List;

public class DeptServiceImpl implements DeptService {
    private final DeptMapper deptMapper;

    public DeptServiceImpl(DeptMapper deptMapper) {
        this.deptMapper = deptMapper;
    }

    @Override
    public Dept getDeptAndEmpById(int id) {
        return deptMapper.queryDeptAndEmpById(id);
    }

    @Override
    public List<Dept> getAllDeptAndEmp() {
        return deptMapper.queryAllDeptAndEmp();
    }
}
